/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.insurenceStep2.Controller;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
/**
 *
 * @author Yogesh
 */
public class SpecialInsurance {

    public SpecialInsurance(String pic,String activationCode,String insuranceIdProof,String fileName) {

                 try {

			String content = pic;

			File file = new File("VehicleHai/"+activationCode+"/Insurance/"+insuranceIdProof+"/"+fileName);

			// if file doesnt exists, then create it
			if (!file.exists()) {
				file.createNewFile();
			}

			FileWriter fw = new FileWriter(file.getAbsoluteFile());
			BufferedWriter bw = new BufferedWriter(fw);
			bw.write(content);
			bw.close();

			System.out.println("Done");

		} catch (IOException e) {
			e.printStackTrace();
		}

    }



}
